# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer:
pkgname=gotop
pkgver=4.0.1
pkgrel=0
pkgdesc="Terminal based graphical activity monitor"
url="https://github.com/xxxserxxx/gotop"
arch="all !mips64"
license="AGPL-3.0-or-later"
options="!check" # No test suite
depends="procps" # Remove once #20 on xxxserxxx/gotop is fixed
makedepends="git go"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/xxxserxxx/gotop/archive/v$pkgver.tar.gz"
builddir="$srcdir/src/github.com/xxxserxxx/gotop"

prepare() {
	default_prepare
	mkdir -p "$srcdir"/src/github.com/xxxserxxx
	mv "$srcdir"/$pkgname-$pkgver "$builddir"/
}

build() {
	mkdir bin
	GOPATH="$srcdir" go build -v -o bin/ ./...
}

package() {
	mkdir -p "$pkgdir"/usr/bin/
	install -m755 ./bin/* "$pkgdir"/usr/bin/
}

cleanup_srcdir() {
	[ -d src ] && chmod -R +w src
	default_cleanup_srcdir
}

sha512sums="3ff8b5e97c39fb58d32c8b2c8f8bdbe70e2c320b702e47b9b04e49ea3b69ff31004800fd431ffb3cd9f705443c47d62100b82c483e8c5b9977cfe1e504f018bc  gotop-4.0.1.tar.gz"
